-- card: 28972 from stack: in.2r -- bmap block id: 0 -- flags: 0000 -- background id: 3837 -- name: FileLength -- part 2 (button) -- low flags: 00 -- high flags: A004 -- rect: left=380 top=270 right=294 bottom=472 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: try me ----- HyperTalk script ----- on mouseUp if the optionkey is down then edit script of me put "Please select a text file..." put filename("TEXT") into temp hide message if temp is empty then exit mouseup put fileLength(temp) end mouseUp -- part contents for background part 5 ----- text ----- FileLength -- part contents for background part 6 ----- text ----- FileLength XFCN returns the size of the data fork of a file in bytes. Anyway, as you can probably guess by it's name, FileLength gets the length of any file whose name you pass to it. I needed this for a stack I'm developing that will be reading text files. If FileLength encounters an error of some sort (can't find the file, or the file is aready open), the result will be zero. If for some strange reason someone tries to open a non-text file, FileLength will work, but will only return the length of the data fork. So opening a program, for example, will probably return a result of zero. "FileLength" is absolutely FREE and was developed with the LightSpeed Pascal Compiler. Source available on request (via GEnie E-Mail or SASE): Jeff Fischer 2246 Olivine Dr. Carbon Canyon, CA 91709 GEnie: JFISCHER ••Note from Steve Drazga, Editor DevStack I would like to publicly thank Jeff for taking the time to send his contribution to the Developer Stack. -- part contents for background part 7 ----- text ----- Syntax: FileLength(<"filePathName>") Returns the length (in bytes) of the data fork of a file. If an error occurs it will return 0. -- part contents for background part 10 ----- text ----- 23